package com.itcast.LocalDate.Demo01;

import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.Month;

/*
要写注释哦!!!
*/
public class Test {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        int dayOfMonth = now.getDayOfMonth();
        System.out.println(dayOfMonth);
        DayOfWeek dayOfWeek = now.getDayOfWeek();
        System.out.println(dayOfWeek);
        int dayOfYear = now.getDayOfYear();
        System.out.println(dayOfYear);
        int year = now.getYear();
        System.out.println(year);
        Month month = now.getMonth();
        System.out.println(month);
        int hour = now.getHour();
        System.out.println(hour);
        int minute = now.getMinute();
        System.out.println(minute);
        int second = now.getSecond();
        System.out.println(second);
        LocalDateTime localDateTime = now.withDayOfMonth(23);
        System.out.println(localDateTime);
        LocalDateTime localDateTime1 = now.plusDays(1);
        System.out.println(localDateTime1);
        LocalDateTime localDateTime2 = now.minusDays(2);
        System.out.println(localDateTime2);
        LocalDateTime now1 = LocalDateTime.now();
        boolean equals = now.equals(now1);
        System.out.println(equals);
        boolean after = now.isAfter(now1);
        System.out.println(after);
        boolean before = now1.isBefore(now);
        System.out.println(before);

    }
}
